/*  
 *  Copyright 2006 Paul Jack.
 *
 *  This file is part of the Dex compiler suite. 
 *  
 *  Dex is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; either version 2 of the License, or (at your
 *  option) any later version.
 *  
 *  Dex is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 *  Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 */
package dex.compiler.checker;


import dex.compiler.problem.Ambiguity;
import dex.compiler.problem.Crime;
import dex.compiler.problem.Disagreement;
import dex.compiler.problem.Omission;


/**
 * The problems that can occur when checking expressions for validity.
 */
final public class ExpressionProblems {

	
	/**
	 * Static enum-like class, do not instantiate.
	 */
	private ExpressionProblems() {
	}
	
	
	final public static Crime BAD_BRACKETS = 
	 new Crime("Can't apply [] to ");
	
	final public static Crime BAD_INDEX =
	 new Crime("Array index must be integer type, not ");
	
	
	final public static Omission MISSING_FUNCTION = 
	 new Omission("Function not found: ");
	
	final public static Ambiguity AMBIGUOUS_FUNCTION = 
	 new Ambiguity("Function defined more than once: ");

	final public static Omission MISSING_VARIABLE = 
	 new Omission("Variable not found: ");
		
	final public static Ambiguity AMBIGUOUS_VARIABLE = 
	 new Ambiguity("Variable defined more than once: ");

	final public static Crime BAD_CALL = 
	 new Crime("Can't call values of type ");
	
	final public static Crime BAD_DOT = 
	 new Crime("Can't apply . to ");
	
	final public static Omission MISSING_MEMBER = 
	 new Omission("Member not found: ");

	//final public static Ambiguity AMBIGUOUS_MEMBER = 
	// new Ambiguity("Member defined more than once: ");

	final public static Omission MISSING_METHOD = 
	 new Omission("Method not found: ");
				
	final public static Ambiguity AMBIGUOUS_METHOD = 
	 new Ambiguity("Method defined more than once: ");

	final public static Crime BAD_FIELD_NAME = 
	 new Crime("Can't qualify field name.");
	
	final public static Crime BAD_METHOD_NAME = 
	 new Crime("Can't qualify method name.");

	final public static Crime RECORD_INVOCATION =
	 new Crime("Can't invoke method on record type ");
	
	final public static Disagreement ILLEGAL_CAST =
	 new Disagreement("Can't cast ");
	
	final public static Disagreement BAD_ARGUMENTS = 
	 new Disagreement("Can't send ");

	final public static Crime BAD_BOOLEAN_OPERATOR =
	 new Crime("Can't send boolean arguments to ");
	
	final public static Crime BAD_BOOLEAN_ARGUMENTS =
	 new Crime("Must send boolean arguments to ");

	final public static Crime BAD_COMPOUND_OPERATOR =
	 new Crime("Can't use compound operands with ");
		
	final public static Crime BAD_COMPOUND_ARGUMENTS =
	 new Crime("Must use compound operands with ");

	final public static Crime BAD_INTEGER_OPERATOR =
	 new Crime("Can't use integer operands with ");
			
//	final public static Crime BAD_INTEGER_ARGUMENTS =
//	 new Crime("Must use integer operands with ");

	final public static Crime BAD_BANG = 
	 new Crime("Can't use ! with ");

	final public static Crime BAD_INTEGER_UNARY = 
	 new Crime("Can't apply unary operator to ");

	final public static Crime INVISIBLE_FUNCTION =
	 new Crime("Function not visible: ");

	final public static Crime INVISIBLE_VARIABLE =
	 new Crime("Varialbe not visible: ");

	final public static Crime INVISIBLE_METHOD =
	 new Crime("Method not visible: ");
	
	final public static Crime INVISIBLE_FIELD =
	 new Crime("Field not visible: ");

	final public static Crime BAD_NEW =
	 new Crime("Can't allocate type: ");
	
	final public static Crime BAD_ARRAY_BOUND =
	 new Crime("Array bounds must be integers, not ");

	final public static Crime BAD_ARRAY_NEW =
	 new Crime("Array type requires bound.");

	final public static Omission MISSING_CONSTRUCTOR = 
	 new Omission("Constructor not found: ");
					
	final public static Ambiguity AMBIGUOUS_CONSTRUCTOR = 
	 new Ambiguity("Constructor defined more than once: ");

	final public static Crime INVISIBLE_CONSTRUCTOR =
	 new Crime("Constructor not visible: ");
	
	final public static Crime BAD_IS_EXP =
	 new Crime("is must operate on object instance, not ");

	final public static Crime BAD_IS_TYPE =
	 new Crime("is must compare object to class type, not ");

}
